package minix.components;

import java.util.ArrayList;
import java.util.List;

import minix.entities.MenyElement;

import org.apache.tapestry5.Asset;
import org.apache.tapestry5.BindingConstants;
import org.apache.tapestry5.Block;
import org.apache.tapestry5.ComponentResources;
import org.apache.tapestry5.annotations.BeforeRenderTemplate;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Path;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.ioc.annotations.Inject;

/**
 * Layout component for pages of application pasienlosjen_web.
 */
public class Layout {
	@SuppressWarnings("unused")
	@Inject
	@Property
	@Path("context:bilder/pasientLosjenLogo.jpg")
	private Asset logo;

	/** The page title, for the <title> element and the <h1>element. */
	@SuppressWarnings("unused")
	@Property
	@Parameter(required = true, defaultPrefix = BindingConstants.LITERAL)
	private String title;

	@SuppressWarnings("unused")
	@Property
	@Parameter(defaultPrefix = BindingConstants.LITERAL)
	private String sidebarTitle;

	@SuppressWarnings("unused")
	@Property
	@Parameter(defaultPrefix = BindingConstants.LITERAL)
	private Block sidebar;

	@SuppressWarnings("unused")
	@Inject
	private ComponentResources resources;
	@Property
	private List<MenyElement> menyelementer;
	@SuppressWarnings("unused")
	@Property
	private MenyElement element;

	@BeforeRenderTemplate
	public void settOppMenyene() {
		menyelementer = new ArrayList<MenyElement>();
		menyelementer.add(new MenyElement("Forsiden", "index"));
		menyelementer.add(new MenyElement("Medlemmer", "profiler"));
		menyelementer.add(new MenyElement("Nominer et nytt medlem", "NominerteMedlemmer"));
		menyelementer.add(new MenyElement("Formålsparagraf", "formaalsparagraf"));
		menyelementer.add(new MenyElement("Min profil", "nyprofil"));
		menyelementer.add(new MenyElement("Logg ut", "utlogging"));
	}
}
